package com.amaker.util;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;


public class DBUtil {
	public Connection getConnection(){
		String url      = "jdbc:mysql://localhost:3306/test";
		String driver   = "com.mysql.jdbc.Driver";
		String user     = "root";
		String password = "root";
		try {
	    Class.forName(driver);
	    return DriverManager.getConnection(url,user,password);
    } catch (ClassNotFoundException e) {
	    e.printStackTrace();
    } catch (SQLException e) {
	    e.printStackTrace();
    }
		return null;
	}
	
	public void close(Connection conn) throws SQLException{
		conn.close();
	}
}
